<?php
session_start();
error_reporting(0);
/**
 * Created by PhpStorm.
 * User: MrHung
 * Date: 8/29/14
 * Time: 9:55 AM
 */
require_once('../../class_ajax_request/classAjax.php');
include_once('../../application/functions.php');
include_once('../../application/DataConfig.php');
$obj = new AjaxRequest();

$userName = $_POST['username'];
$fbData = $_SESSION['fbLoginData'];
$fbData['username'] = str_replace(" ","_",trim(($_POST['username']))) ;
$userIdAfterInsert = $obj->signUpWithFb($fbData);

$_SESSION['username']      = $fbData['username'];
$_SESSION['authenticated'] = $userIdAfterInsert;
$_SESSION['lang_user']     = $fbData['language'];
unset($_SESSION['fb_redirect']) ;
//header("Location: ".URL_BASE);
echo json_encode(
    array(
        'status'=>true,
    )
); die;
